package com.wuji1626.spark.rdd.create

import org.apache.spark.{SparkConf, SparkContext}

object RDD_Memory_Create {
    def main(args: Array[String]): Unit = {
        // Step1: 准备环境
        val sparkConf = new SparkConf().setMaster("local[*]").setAppName("RDDCreate")
        val sc = new SparkContext(sparkConf)

        // Step2: 创建 RDD
        val seq = Seq[Int](1, 2, 3, 4)
        // val rdd = sc.parallelize(seq)
        val rdd = sc.makeRDD(seq)

        rdd.collect().foreach(println)
        // Step3: 关闭环境
        sc.stop()
    }
}
